# -*- coding: utf-8 -*-
# @project: huawang-api20230914
# @file： env.py
# @Time：2023/8/16 15:19
# @Author：liaogan
class Env:  # 参考 selenium的 Keys, By的做法
    HOST = 'http://testview.booseng.com/hwyd/#/login?redirect=%2Fdashboard'
    MAINPAGE_URL = 'http://testview.booseng.com/hwyd/#/dashboard'
    BROWSER_TYPE = 'chrome'  # 当前项目的默认的浏览器类型
    PAGE_LOAD_TIMEOUT = 20  # 页面最大加载超时时间
    HEADLESS_FLAG = False  # True 就是无头，False就是有头
    TIMEOUT = 15  # 显式等待最大超时时间
    POLL_FREQUENCY = 0.5  # 显式等待轮询时间

    ADMIN_USER = 'admin'
    ADMIN_PASSWORD = 'huawang333.'
    ADMIN_VerificationCode = '123456'

class Elements:
    # 登录页
    USERNAME_LOCATOR = 'id', 'username'
    PASSWORD_LOCATOR = 'id', 'password'
    LOGIN_BUTTON_LOCATOR = 'id', 'btnLogin'
    MAINPAGE_TEXT_LOCATOR = 'css selector', '.no-redirect'  # 首页
    USER_CENTER_LOCATOR = 'xpath', "//i[@class='el-icon-caret-bottom']"  # 点击个人中心下拉菜单
    LOGOUT_LOCATOR = 'xpath', "//li[@class='el-dropdown-menu__item el-dropdown-menu__item--divided']"  # 点击退出按钮
    Verify_Button = 'xpath', "//span[contains(text(),'确定')]"  # 点击确认按钮

if __name__ == '__main__':
    print(Env.POLL_FREQUENCY)
    print(Elements.Verify_Button)
